#@layout("角色授权列表")
#define css()
	<style>
        a{
            color: #009688;
        }
        a:hover{
            color: #004a43;
            text-decoration: underline;
        }
    </style>
#end
#define main()
<div class="timo-detail-page">
	<table class="layui-table">
		<thead>
           <tr>
			   <th>选择</th>
               <th>类型</th>
               <th>电话</th>
           </tr>
		</thead>
		<tbody>
			#for(item : wechatTemplateList)
			<tr>
			   <td><input type="radio" name="wechatTemplateId" value="#(item.id)" title="男" ></td>
               <td>#(joyDict.getDictLabel(item.responseType.toString(),'template_response_type',''))</td>
               <td>#(item.eventKeywords)</td>
           </tr>
           #end
           #if(wechatTemplateList.size() == 0)
           <tr>
               <td style="text-align: center" colspan="3">未配置模版</td>
			</tr>
		   #end
		</tbody>
	</table>
</div>
#end
#define js()
	<script type="text/javascript">
	layui.use(['form','jquery'], function () {
		var $ = layui.jquery;
		$("#go").click(function(){
			var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
			var $checkboxElts = $("#content input[type='checkbox']:checked");
			if ($checkboxElts.length == 0) {
				layui.use('layer',function () {
					layer.open({
						title:'提示',
						content:'请勾选一条单据'
					});
					});
			} else if ($checkboxElts.length > 1) {
				layui.use('layer',function () {
					layer.open({
						title:'提示',
						content:'抱歉，您选择了多条单据！'
					});
					});
			} else {
				var payid = $checkboxElts.val();
				$.ajax({
					url:'edit',
					data:{'payid':payid},
					dataType:'json',
					success:function(data){
						parent.layer.close(index);
						parent.$("#a_payid").val(data.payid);
						parent.$("#a_operater").val(data.operater);
						parent.$("#a_proName").val(data.proName);
						parent.$("#a_codeName").val(data.codeName);
						parent.$("#a_sum").val(data.sum);
						parent.$("#a_company").val(data.companyName);
						parent.$("#a_team").val(data.teamName);
						parent.$("#a_payee").val(data.payee);
						parent.$("#a_remark").val(data.remark);
						parent.$("#a_department").val(data.departmentId);
						parent.$("#a_type").val(data.type);
						parent.$("#caretes").modal("show");
					}
				})
				
			}
		});
	});
	</script>
#end